x86_32: Assert map_domian_page() not used too early.
authorKeir Fraser <keir@xen.org>
Fri, 21 Jan 2011 15:57:18 +0000 (15:57 +0000)
committerKeir Fraser <keir@xen.org>
Fri, 21 Jan 2011 15:57:18 +0000 (15:57 +0000)
Signed-off-by: Fengzhe Zhang <fengzhe.zhang@intel.com>
xen/arch/x86/x86_32/domain_page.c

index 55a3380776039a8820ba157e10fbb80d9a3b579a..4fb563d4f0fc0ba3a917c32eaf76be79f8cece8c 100644 (file)
@@ -53,6 +53,8 @@ void *map_domain_page(unsigned long mfn)
     perfc_incr(map_domain_page_count);
 
     v = mapcache_current_vcpu();
+    /* Prevent vcpu pointer being used before initialize. */
+    ASSERT((unsigned long)v != 0xfffff000);
 
     dcache = &v->domain->arch.mapcache;
     vcache = &v->arch.mapcache;